// index.js
Page({
  data:{
    cdList:[
      {"cdName":"污味少女心","cdTime":"最早可约18:30","money":"398/h","star":"5.0"},
      {"cdName":"不吃香菜","cdTime":"最早可约20:30","money":"288/h","star":"5.0"},
      {"cdName":"软萌兔兔酱","cdTime":"最早可约19:30","money":"199/h","star":"5.0"}
    ]
  },
  showMsg(){
    console.log("你好");
    wx.vibrateLong();
  },

  // 获取数据
  onReady(){
    api.getMsg().then(data =>
      console.log(data)
    );
  },
  loadAudio(url){
    return new Promise((resolve) => {
      wx.request({
        url,
        responseType: 'arraybuffer',
        success: res => {
          console.log('res.data', res.data)
          audioCtx.decodeAudioData(res.data, buffer => {
            resolve(buffer)
          }, err => {
            console.error('decodeAudioData fail', err)
            reject()
          })
        },
        fail: res => {
          console.error('request fail', res)
          reject()
        }
      })
    })
  },
  jumpTo(){
    console.log("点击了")
    wx.navigateTo({
      url: '/secondPage/venueDetails/venueDetails',
    })
  },
  onShow(){
    wx.request({
      url: 'http://192.168.0.97/site/getSiteInfo',
      success:function(data){
        console.log(data.data.data);
      }
    })
  }
})
